ZennoLab Assemblies Documentation
AddRange(HtmlElement[]) Method
See Also  Example Send Feedback
ZennoLab.CommandCenter Assembly > ZennoLab.CommandCenter Namespace > HtmlElementCollection Class > AddRange Method : AddRange(HtmlElement[]) Method
elements

Type: Zennolab.CommandCenter.HtmlElementCollection[]

The array whose html elements should be added to the end of the HtmlElementCollection. The collection itself cannot be null.

Glossary Item Box

Adds the htm elements of the specified array to the end of the HtmlElementCollection.

Syntax

C# 
public void AddRange( 
   HtmlElement[] elements
)

Parameters

elements

Type: Zennolab.CommandCenter.HtmlElementCollection[]

The array whose html elements should be added to the end of the HtmlElementCollection. The collection itself cannot be null.

Remarks

The order of the elements in the collection is preserved in the HtmlElementCollection.

Example

The following code example demonstrates the AddRange method and various other methods of the HtmlElementCollection class that act on ranges.The AddRange method is called, with the array as its argument. The result is that the current elements of the list are added to the end of the list, duplicating all the elements.
C#Copy Code
using System;
using Zennolab.CommandCenter;
 
namespace Sample
{
    internal class Example
    {
        public static int Execute(Instance instance)
        {
            instance.ClearCookie();
 
            Tab tab = instance.MainTab;
            if ((tab.IsVoid) || (tab.IsNull)) return -1;
            if (tab.IsBusy) tab.WaitDownloading();
            tab.Navigate("lessons.zennolab.com");
            if (tab.IsBusy) tab.WaitDownloading();
 
            HtmlElementCollection heCol = tab.FindElementsByTags("input:checkbox");
        
            HtmlElementCollection newHeCol = tab.FindElementsByTags("input:radio");
            
            heCol.AddRange(newHeCol.Elements);
            
            return 0;
        }
    }
}
PHPCopy Code
<?php
namespace System;
namespace Zennolab\CommandCenter;
 
class Example
{
    public static function Execute($instance)
    {
        $instance->ClearCookie();
 
        $tab = $instance->MainTab;
        if (($tab->IsVoid) || ($tab->IsNull)) return -1;
        if ($tab->IsBusy) $tab->WaitDownloading();
        $tab->Navigate("lessons.zennolab.com");
        if ($tab->IsBusy) $tab->WaitDownloading();
 
        $heCol = $tab->FindElementsByTags("input:checkbox");
            
        $newHeCol = $tab->FindElementsByTags("input:radio");
            
        $heCol->AddRange($newHeCol->Elements);
        
        return 0;
    }
}
?>

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.